import { Base } from '../../../utils/base.js';
class HomeIndex extends Base {
  constructor() {
    super();
  }

  // 收集formid
  add_form(data,callback) {
    var param = {
      url: 'common/add_form',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  //获取新人优惠券
  config(callback){
    var param = {
      url: 'common/config',
      type: "post",
      data: {},
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  getOrder(data, callback) {  //订单
    
    var param = {
      url: 'order/index',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  getCountCity(data, callback) {  //获取门店数量
    var param = {
      url: 'goods/city',
      type: "post",
      data: data,
      loading: "hide",
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }
  /*获取门店信息*/
  getgoodslist(data, callback) {  //获取首页门店
    var param = {
      loading : "hide",
      url: 'goods/index',
      type: "post",
      data: data,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  //广告图
  gethui(data, callback) {   //新人优惠券
    var param = {
      url: 'goods/recei_coupon',
      type: "post",
      data: data,
      loading:"hide",
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  gomap(){            //地图找店
    var param = {
      url:'goods/map',
      type:"post",
      data: data,
      loading: "hide",
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }


  getBanner(callback){
    var param = {
      url:'common/banner',
      type:"post",
      data: {},
      loading: "hide",
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
   
  }
};
export { HomeIndex };